interface ResponseModal<T> {
    code: number,
    message: string,
    result?: T extends boolean ? boolean : T[],
    success: boolean,
    timestamp: number,
}

interface ResponsePageModal<T> {
    code: number,
    message: string,
    result?: T extends boolean ? boolean : {
        data?: T[],
        pageNum?: number,
        pageSize?: number,
        total?: number
    },
    success: boolean,
    timestamp: number,
}

interface ResponseSingleModal<T> {
    code: number,
    message: string,
    result?: T,
    success: boolean,
    timestamp: number,
}

interface ResponseDatasetData {
    datasetId: string,
    collectionId: string,
    _id: string,
    q: string,
    a: string,
    chunkIndex: number,
}

interface ResponseDataList {
    list: ResponseDatasetData[],
    total: number
}

interface ResponseDatasetDataIndex {
    defaultIndex: boolean,
    dataId: string,
    text: string,
    _id: string
}

interface ResponseDatasetDataDetail {
    sourceId: string,
    q: string,
    a: string,
    indexes: ResponseDatasetDataIndex[],
    isOwner: boolean,
    teamId: string,
    datasetId: string,
    updateTime: string,
    id: string,
    sourceName: string,
    chunkIndex: number,
    collectionId: string
}

interface ResponseMCPConfig {
    name: string,
    desc: string
}

export type {
    ResponseModal,
    ResponsePageModal,
    ResponseSingleModal,
    ResponseDatasetData,
    ResponseDataList,
    ResponseDatasetDataDetail,
    ResponseMCPConfig,
}